//
//  HomePage.swift
//  民生生活
//
//  Created by apple on 2017/8/4.
//  Copyright © 2017年 youjindi.app.com. All rights reserved.
//

import UIKit

class HomePage: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        setView()
    }

    func setView() -> Void{
        view.backgroundColor = MainBackGroundColor
        view.addSubview(mainScroll)
        mainScroll.addSubview(header)
        mainScroll.addSubview(python)
        mainScroll.addSubview(happy)
        mainScroll.contentSize = CGSize(width: ScreenWidth, height: happy.frame.maxY)
    }
    
    let mainScroll = UIScrollView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
    
    lazy var header: HomePageHeaderView = {
        let header = HomePageHeaderView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 340))
        return header
    }()
    
    lazy var python: HomePagePythonView = {
        let python = HomePagePythonView(frame: CGRect(x: 0, y: self.header.frame.maxY + 10, width: ScreenWidth, height: 200))
        return python
    }()
    
    lazy var happy: HomePageHappyView = {
        let happy = HomePageHappyView(frame: CGRect(x: 0, y: self.python.frame.maxY + 10, width: ScreenWidth, height: 200))
        return happy
    }()
    
    let viewModel = HomePageViewModel()

    
}
